//**********流程***********/;
import request from '@/utils/request.js';

/**
 * 保存
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * data 参数 
 *  description:'', //流程描述 	类型:string 非必填
 *  folderId:'', //所属文件夹 	类型:integer 非必填
 *  key:'', //流程KEY 	类型:string 非必填
 *  name:'', //流程名称 	类型:string 非必填
 * @returns
 * ********
 */
export function postHmprocess(data={}, config={}){
  return request({
    method: 'post',
    data,
    url: `/api/hm-process`,
    ...config,
  }) 
}

/**
 * 修改
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * data 参数 
 *  description:'', //流程描述 	类型:string 非必填
 *  id:'', //唯一建 	类型:integer 非必填
 *  name:'', //流程名称 	类型:string 非必填
 * @returns
 * ********
 */
export function putHmprocess(data={}, config={}){
  return request({
    method: 'put',
    data,
    url: `/api/hm-process`,
    ...config,
  }) 
}

/**
 * 删除
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * data 参数 // 类型 array
 * []integer
 * @returns
 * ********
 */
export function deleteHmprocess(data=[], config={}){
  return request({
    method: 'delete',
    data,
    url: `/api/hm-process`,
    ...config,
  }) 
}

/**
 * 激活版本
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * data 参数 
 *  id:'', // 	类型:integer 非必填
 * @returns
 * ********
 */
export function putHmprocessActivate(data={}, config={}){
  return request({
    method: 'put',
    data,
    url: `/api/hm-process/activate`,
    ...config,
  }) 
}

/**
 * 拷贝流程
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * data 参数 
 *  description:'', //流程描述 	类型:string 非必填
 *  key:'', //流程KEY 	类型:string 非必填
 *  name:'', //流程名称 	类型:string 非必填
 *  sourceId:'', //源流程ID 	类型:integer 非必填
 * @returns
 * ********
 */
export function postHmprocessCopy(data={}, config={}){
  return request({
    method: 'post',
    data,
    url: `/api/hm-process/copy`,
    ...config,
  }) 
}

/**
 * 保存部署流程设计
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * data 参数 
 *  id:'', //流程id 	类型:integer 非必填
 *  json:'', //流程设计json 	类型:string 非必填
 * @returns
 * ********
 */
export function putHmprocessDeploy(data={}, config={}){
  return request({
    method: 'put',
    data,
    url: `/api/hm-process/deploy`,
    ...config,
  }) 
}

/**
 * 历史版本
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * params 参数 
 * key:'', //流程KEY 非必填
 * @returns
 * ********
 */
export function getHmprocessHistory(params={}, config={}){
  return request({
    method: 'get',
    params,
    url: `/api/hm-process/history`,
    ...config,
  }) 
}

/**
 * 详情
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * params 参数 
 * id:'', //id 必填
 * includeXml:'', //includeXml 非必填
 * @returns
 * ********
 */
export function getHmprocessInfo(params={}, config={}){
  return request({
    method: 'get',
    params,
    url: `/api/hm-process/info`,
    ...config,
  }) 
}

/**
 * 列表
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * params 参数 
 * activated:'', //activated 非必填
 * @returns
 * ********
 */
export function getHmprocessList(params={}, config={}){
  return request({
    method: 'get',
    params,
    url: `/api/hm-process/list`,
    ...config,
  }) 
}

/**
 * 创建新版本
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * data 参数 
 *  description:'', // 	类型:string 非必填
 *  sourceId:'', // 	类型:integer 非必填
 *  sourceKey:'', // 	类型:string 非必填
 * @returns
 * ********
 */
export function postHmprocessMakeversion(data={}, config={}){
  return request({
    method: 'post',
    data,
    url: `/api/hm-process/make-version`,
    ...config,
  }) 
}

/**
 * 移动流程
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * data 参数 
 *  folderId:'', // 	类型:integer 非必填
 *  id:'', // 	类型:integer 非必填
 * @returns
 * ********
 */
export function putHmprocessMove(data={}, config={}){
  return request({
    method: 'put',
    data,
    url: `/api/hm-process/move`,
    ...config,
  }) 
}

/**
 * 分页列表
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * params 参数 
 * folderId:'', //文件夹ID 非必填
 * searchKey:'', //查找关键字 非必填
 * pageNo:'', //页码 非必填
 * pageSize:'', //每页数据条数 非必填
 * @returns
 * ********
 */
export function getHmprocessPageList(params={}, config={}){
  return request({
    method: 'get',
    params,
    url: `/api/hm-process/page/list`,
    ...config,
  }) 
}

/**
 * 发布版本
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * data 参数 
 *  id:'', // 	类型:integer 非必填
 * @returns
 * ********
 */
export function putHmprocessPublish(data={}, config={}){
  return request({
    method: 'put',
    data,
    url: `/api/hm-process/publish`,
    ...config,
  }) 
}

/**
 * 获取开始节点表单Key
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * params 参数 
 * processKey:'', //processKey 必填
 * @returns
 * ********
 */
export function getHmprocessStartformkey(params={}, config={}){
  return request({
    method: 'get',
    params,
    url: `/api/hm-process/start-form-key`,
    ...config,
  }) 
}

/**
 * 根据模型ID获取可用的流程
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * params 参数 
 * modelId:'', //modelId 必填
 * @returns
 * ********
 */
export function getHmprocessUsable(params={}, config={}){
  return request({
    method: 'get',
    params,
    url: `/api/hm-process/usable`,
    ...config,
  }) 
}

/**
 * 字段重复检查
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * params 参数 
 * field:'', //field 必填
 * value:'', //value 必填
 * id:'', //id 非必填
 * @returns
 * ********
 */
export function getHmprocessValidfield(params={}, config={}){
  return request({
    method: 'get',
    params,
    url: `/api/hm-process/valid-field`,
    ...config,
  }) 
}

/**
 * 删除版本
 * @doc http://hanma-lesscode.hc-iiot.com/swagger-ui.html#!/
 * data 参数 // 类型 array
 * []integer
 * @returns
 * ********
 */
export function deleteHmprocessVersion(data=[], config={}){
  return request({
    method: 'delete',
    data,
    url: `/api/hm-process/version`,
    ...config,
  }) 
}